home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20031118-20041115
/
000033_fdc@columbia.edu_Tue Dec 2 09:55:38 2003.msg
< prev
next >
Wrap
Internet Message Format
|
2004-11-14
|
3KB
Path: newsmaster.cc.columbia.edu!not-for-mail
From: Frank da Cruz <fdc@columbia.edu>
Newsgroups: comp.protocols.kermit.misc
Subject: Re: wierd scripting query via telnet
Date: 2 Dec 2003 14:47:51 GMT
Organization: Columbia University
Lines: 61
Message-ID: <slrnbsp9gn.bcn.fdc@sesame.cc.columbia.edu>
References: <e516d9ec.0312020211.2fa9cb80@posting.google.com>
Reply-To: fdc@columbia.edu
NNTP-Posting-Host: sesame.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1070376471 12159 128.59.59.56 (2 Dec 2003 14:47:51 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 2 Dec 2003 14:47:51 GMT
User-Agent: slrn/0.9.7.4 (SunOS)
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:14709
In article <e516d9ec.0312020211.2fa9cb80@posting.google.com>,
Mark Swarbrick wrote:
: I'm trying to write a little utility which does the following:
:
: connect via telnet to port 1494 (citrix ica) wait about 5 seconds
: after connecting and dump to a bash variable the contents of what was
: echoed to screen for checking if the citrix machine is working
: properly.
:
Conceptually it's easy (except for the "bash variable" part; see below).
In practice it depends on whether Citrix ICA is normal enough to allow a
regular non-protocol raw-socket connection to be made to it. I have no
idea.
: The citrix ica client just echo's ICAICA until it closes the port.
: this takes too long so i just want to script kermit-telnet to keep the
: connection open for around 5 seconds and keep the data so I can check
: the contents.
:
: How would I go about this?
:
: So far all i've got is:
:
: #!/usr/local/bin/kermit
: telnet /nowait 102.12.76.37 1494
:
: But this takes ages to run and doesn't dump back the contents...
:
If it takes ages to run, then maybe there's something about Citrix that
Kermit needs to know, but does not. Is it using some Microsoft-specific
protocol, such as VTNT? If so, C-Kermit does not support it (but K95
might).
Leaving Citrix out of the picture, let's say you were making a connection
to some normal, text-based TCP service and you wanted to capture 5 seconds
worth of whatever it spewed out:
clear input
set host 102.12.76.37 1494 /raw
input 5 STRING_THAT_WILL_NEVER_COME
if success exit 1 "Uh oh - STRING_THAT_WILL_NEVER_COME did come!"
close
At this point all the characters that arrived (except NULs) are in the
Kermit variable \v(input). You can do whatever you want with this variable
except assign its value to a bash variable that will be visible when the
script (and Kermit) exit, because of a fundamental rule of Unix: a process
may not manipulate the environment of a superior process.
To pass the value back to bash, you could write it out to a file. That's
easy enough:
log session
set host 102.12.76.37 1494 /raw
input 5 STRING_THAT_WILL_NEVER_COME
if success exit 1 "Uh oh - STRING_THAT_WILL_NEVER_COME did come!"
exit 0
All the bytes that arrived will be in the session.log file.
- Frank